<template>
  <div>
    <div v-if="bannerUrlArr.length > 0">
      <HomeSwiper :bannerUrlArr="bannerUrlArr" />
    </div>
    <HemoMovement />
    <HomeHear />
    <HemoJoy />
    <HomeTalk />
    <HomeTravelNotes />
    <HomeElse />
  </div>
</template>

<script>
import HomeSwiper from "./HomeSwiper";
import HemoMovement from "./HemoMovement";
import HomeHear from "./HomeHear";
import HemoJoy from "./HemoJoy";
import HomeTalk from "./HomeTalk";
import HomeTravelNotes from "./HomeTravelNotes";
import HomeElse from "./HomeElse";
export default {
  name: "Home",
  data() {
    return {
      bannerUrlArr: [],
      msg: {
        username: "",
        flag: false,
      },
    };
  },
  mounted() {
    this.$api.HomeBanner().then((res) => {
      if (res.status === 200) {
        this.bannerUrlArr = res.data.banner;
      }
    });
    if (localStorage.getItem("blueberryUser")) {
      this.msg = JSON.parse(localStorage.getItem("blueberryUser"));
    }
    this.$bus.$emit("msg", this.msg);
  },
  components: {
    HomeSwiper,
    HemoMovement,
    HomeHear,
    HemoJoy,
    HomeTalk,
    HomeTravelNotes,
    HomeElse,
  },
};
</script>
<style lang="less" scoped>
</style>